<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <p>品牌 <input type="text" v-model="info.brand"> </p>
        <p>型号 <input type="text" v-model="info.series"> </p>
        <p>生产日期 <input type="text" v-model="info.creation"> </p>
        <ul>
            <li v-for="(item,index) in newArr">
                <p>品牌:{{item.brand}}</p>
                <p>型号:{{item.series}}</p>
                <p>生产日期:{{item.creation}}</p>
            </li>
        </ul>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        const list = [{
                        brand: "奥迪",
                        series: "奥迪A4",
                        creation: "2021"
                    },
                    {
                        brand: "奥迪",
                        series: "奥迪A6",
                        creation: "2021"
                    },
                    {
                        brand: "奥迪",
                        series: "奥迪A6",
                        creation: "2020"
                    },
                    {
                        brand: "奥迪",
                        series: "奥迪A8",
                        creation: "2020"
                    },
                    {
                        brand: "奔驰",
                        series: "奔驰A8",
                        creation: "2020"
                    },
                ];
        new Vue({
            el: '#app',
            data: {
                index:0,
                arr: list,
                newArr:list,
                info: {
                    brand: '',
                    series: '',
                    creation: '',
                }
            },
        watch:{
            info:{
                deep:true,
                handler(newValue,oldValue){
                  this.newArr = this.arr.filter((item)=>{
                      return item.brand === newValue.brand//只能写出来一层
                  })
                 }
             }
         }
        })
    </script>
<script>
//       watch: {
//             keyword () {
//                 //函数节流
//                 if (this.timer) {
//                     clearTimeout(this.timer)
//                 }
//                 //删除文字  清零
//                 if (!this.keyword) {
//                     this.cityList = []
//                     return
//                 }
//                 this.timer = setTimeout(() => {
//                     const result = []
//                     this.jsonData.forEach(val => {
//                         if (val.name.indexOf(this.keyword) > -1) {
//                             result.push(val.name)
//                         }
//                     });
//                     this.cityList = result
//                     console.log(this.cityList)
//                 }, 100)
//             }
//         }
        
</script>
</body>

</html>